using System;

namespace QueryBuilder.Core.Visualization.QueryVisualization
{
    public abstract class VisualizableVariable : VisualizableConstraint
    {
        
    }

    public class VisualizableVariable<T> : VisualizableVariable
    {
        public VisualizableVariable(T value)
        {
            this.Value = value;
        }
        /// <summary>
        /// 
        /// </summary>
        private Type type;

        /// <summary>
        /// 
        /// </summary>
        private T variable;

        /// <summary>
        /// Gets or sets the type.
        /// </summary>
        /// <value>The type.</value>
        public Type Type
        {
            get { return this.type; }
            set { this.SetValue(ref this.type, value, () => this.Type); }
        }

        /// <summary>
        /// Gets or sets the value.
        /// </summary>
        /// <value>The value.</value>
        public T Value
        {
            get { return this.variable; }
            set { this.SetValue(ref this.variable, value, () => this.Value); }
        }

        /// <summary>
        /// Accepts the specified visitor.
        /// </summary>
        /// <param name="visitor">The visitor.</param>
        public override void Accept(IVisualizableConstraintVisitor visitor)
        {
            visitor.Visit(this);
        }

        public override void AddChild(VisualizableConstraint visualizableConstraint)
        {
            throw new NotSupportedException();
        }

        public override void RemoveChild(VisualizableConstraint visualizableConstraint)
        {
            throw new NotSupportedException();
        }
    }
}